<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>用户列表</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/themes/icon.css"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/demo.css"/>
	<script src="${pageContext.request.contextPath }/plugins/jQuery/jquery.min.js"></script>
	<script src="${pageContext.request.contextPath }/plugins/jQuery/jquery.easyui.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/jQuery/easyui-lang-zh_CN.js"></script>
	<link href="${pageContext.request.contextPath }/admin/css/jqPaginator.css" rel="stylesheet" type="text/css"/>
<script src="${pageContext.request.contextPath }/admin/js/jqPaginator.js"></script>
	<script type="text/javascript">
		$(function(){
			// 下单日期
			$('#orderDate').datebox({    
			    required:true,
			    editable:true  
			});
			
			// 提货仓列表
			$('#takeStationId').combobox({
				valueField:'station_id',
				textField:'station_name',
				url:'${pageContext.request.contextPath }/admin/station/findStationByKind/1'
			});
			<c:choose>
				<c:when test="${stationId eq null }">$('#takeStationId').combobox("setValue",-1);</c:when>
				<c:otherwise>$('#takeStationId').combobox("setValue",${stationId});</c:otherwise>
			</c:choose>
					
			// 订单状态下拉列表
			$('#orderStatus').combobox({
				valueField:'value',
				textField:'text',
				editable:false,
				data:[{"value":"-1","text":"全部"},
					{"value":"no_pay","text":"待付款"},
					{"value":"nosend","text":"待发货"},
					{"value":"no_pick","text":"待提货"},
					{"value":"finsh","text":"已完成"}
				]
			});
			<c:choose>
				<c:when test="${orderStatus eq null }">$('#orderStatus').combobox("setValue","-1");</c:when>
				<c:otherwise>$('#orderStatus').combobox("setValue","${orderStatus}");</c:otherwise>
			</c:choose>
			
		});
		
		function doSub(){
			$('#fForm').submit();
		}
		
		function showPage(num){
			$('#num').val(num);
			$('#fForm').submit();
		}
		

	</script>
	<style type="text/css">
		body{
		font-family:'微软雅黑';}
	</style>
	<style type="text/css">
	.unit{ width:1200px; height:auto; border:1px solid #999; font-size:12px; font-family:'微软雅黑'}
	.unit-title{ width:1200px;height:70px; line-height:70px; vertical-align:middle;}
	.unit-title-left{ width:800px; height:62px;  line-height:62px; vertical-align:middle;float:left;padding-left:35px; padding-top:8px;}
	.unit-title-right{ width:300px; height:70px; float:left;}
	.unit-title-1{ width:330px; height:25px; line-height:25px; vertical-align:middle; float:left;}
	.unit-title-2{ width:280px; height:25px; line-height:25px; vertical-align:middle; float:left;}
	.unit-title-3{ width:180px; height:25px; line-height:25px; vertical-align:middle; float:left;}
	.unit-title-cnt{ width:1200px; height:38px;  font-size:14px; border-top:1px solid #CCCCCC;  background-color:#F0F0F0;}
	.unit-title-cnt1{ width:1200px; height:38px;  font-size:14px; border-top:1px solid #CCCCCC; }
	.cnt1{ width:390px; padding-left:35px; float:left; height:38px; line-height:38px; vertical-align:middle;}
	.cnt2{ width:115px; padding-left:35px; float:left; height:38px; line-height:38px; vertical-align:middle;}
	.f-b{ font-weight:bold;}
	.unit-bottom{width:1200px;height:70px; line-height:70px;  background-color:#FAFAFA;border-top:1px solid #CCCCCC;  }
	.unit-bottom-l{ width: 610px;height:60px; line-height:60px; float:left; padding-left:35px; margin-top:-8px;}
	.unit-bottom-r{ width: 500px;height:60px; line-height:60px; float:left; margin-top:-8px;}
	.unit-cnt-1{}
	.unit-cnt-2{}
	.unit-cnt-3{ width:180px; height:25px; float:left;}
	.s-title{width:1200px; height:120px; line-height:100px; vertical-align:middle; font-size:14px; font-family:'微软雅黑'; padding-left:20px;}
	.s-title-1{width:250px; height:50px; line-height:50px; vertical-align:middle; float:left;}
	.s-cnt-left{ width:70px; height:50px; line-height:50px; vertical-align:middle; float:left; text-align:right;}
	.s-cnt-right{ width:160px; height:50px; line-height:50px; vertical-align:middle; float:left; margin-top:12px;}
</style>
  </head>
  
  <body>
<div style="width:1245px;height:650px; overflow:scroll;"> 
<form action="${pageContext.request.contextPath }/order/orderDetailsList" method="post" id="fForm">
<div class="s-title">
	<div class="s-title-1">
    	<div class="s-cnt-left">下单时间：</div><div class="s-cnt-right">
    		<input type="text" name="orderDate" id="orderDate" style="width:150px;height:22px;" value="${orderDate }"/>
    	</div>
    </div>
    <div class="s-title-1"><div class="s-cnt-left">提货仓：</div><div class="s-cnt-right"><input id="takeStationId" name="stationId" style="width:150px;height:22px;"/></div></div>
    <div class="s-title-1"><div class="s-cnt-left">订单状态：</div><div class="s-cnt-right"><input id="orderStatus" name="orderStatus" style="width:150px;height:22px;"/></div></div>
    <div class="s-title-1"><div class="s-cnt-left">&nbsp;</div><div class="s-cnt-right">&nbsp;</div></div>
    <div class="s-title-1"><div class="s-cnt-left">订单号：</div><div class="s-cnt-right"><input type="text" name="orderId" style="width:150px;height:22px;" class="easyui-textbox" value="${orderId }"/></div></div>
    <div class="s-title-1"><div class="s-cnt-left">买家姓名：</div><div class="s-cnt-right"><input type="text" name="custName" style="width:150px;height:22px;" class="easyui-textbox" value="${custName }"/></div></div>
    <div class="s-title-1"><div class="s-cnt-left">手机号码：</div><div class="s-cnt-right"><input type="text" name="mobile" style="width:150px;height:22px;" class="easyui-textbox" value="${mobile }"/></div></div>
    <div class="s-title-1" style="width:280px;padding-left:10px;"><a href="javascript:doSub()" class="easyui-linkbutton" style="width:80px;">查找</a></div>
    <div style="clear:left"><input type="hidden" id="num" name="num" value="1"/></div>
</div>
</form>
<div style="clear:left"></div>
<c:forEach items="${data }" var="order">
<div class="unit">
	<div class="unit-title">
    	<div class="unit-title-left">
        	<div class="unit-title-1">提货仓：<span style="color:#FF7926;">${order[9] }</span> </div>
            <div class="unit-title-2">提货人：<span style="color:#FF7926;">${order[8] }</span> </div>
            <div class="unit-title-3">订单状态：<span style="color:#FF7926;">${order[5] }</span> </div>
            <div class="unit-title-1">提货电话：${order[10] }  </div>
            <div class="unit-title-2">订货时间：${order[1] } </div>
            <div class="unit-title-3">提货时间：${order[11] } </div>
            <div style="clear:left;"></div>
        </div>
        <div class="unit-title-right">
        	<c:if test="${order[5] eq '待发货' and LOGIN_USER.ROLE ne 8 }">
        		<a href="javascript:location.href='${pageContext.request.contextPath }/order/updateOrder/2-${order[0] }'" class="easyui-linkbutton" style="width:80px;">确认发货</a></span>
        	</c:if>
        </div>
        <div style="clear:left;"></div>
    </div>
    <div class="unit-title-cnt">
    	<div class="cnt1 f-b">SKU名称（销售规格）</div>
        <div class="cnt2 f-b">原价</div>
        <div class="cnt2 f-b">订货数量</div>
        <div class="cnt2 f-b">下单金额</div>
       	<div class="cnt2 f-b">实付金额</div> 
        <div class="cnt2 f-b">退货数量</div>
        <div style="clear:left;"></div>
    </div>
    <c:forEach items="${order[7] }" var="item">
    <div class="unit-title-cnt1">
    	<div class="cnt1">${item[0] }</div>
        <div class="cnt2">${item[2] }</div>
        <div class="cnt2">${item[3] }</div>
        <div class="cnt2">${item[2] * item[3] }</div>
       	<div class="cnt2">${item[2] * item[3] }</div> 
        <div class="cnt2">0</div>
        <div style="clear:left;"></div>
    </div>
    </c:forEach>
    <div class="unit-bottom">
    	<div class="unit-bottom-l">
        	<div style="width:600px;height:25px;">订单号：${order[0] }</div>
            <div style="width:600px;height:25px;">下单时间：${order[1] }</div>
        </div>
        <div class="unit-bottom-r">
        	<div style="width:560px;height:25px;">下单金额：<span style="color:#FF7926;">${order[2] }元</span></div>
            <div style="width:560px;height:25px;">
            	<div class="unit-cnt-3">优惠金额：<span style="color:#FF7926;">${order[3] }元</span> </div>
                <div class="unit-cnt-3">运费金额：<span style="color:#FF7926;"> 0 元</span></div>
                <div class="unit-cnt-3">实付金额：<span style="color:#FF7926;">${order[4] }元</span></div>
            </div>
        </div>
    </div>
</div>
<div style="height:40px; clear:left;"></div>
</c:forEach>
<div>
	<div class="pager">
            <ul class="pagination" id="pagination1"></ul>
            <script type="text/javascript">
            	var url="${pageContext.request.contextPath }/order/orderDetailsList";
               $.jqPaginator('#pagination1', {
                   totalPages: ${pages},
                   visiblePages: 6,
                   currentPage: ${currentPage},
                   onPageChange: function (num, type) {
                       if(type=="change"){
                //            location.href=url+"?num="+num;
                			showPage(num);
                       }
                      
                   }
               });
            </script>
 	</div>
 </div>
<br/><br/>
</div>
  </body>
</html>
